package com.kaiwukj.android.ufamily.mvp.ui.page.keeper;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.kaiwukj.android.ufamily.R;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.KeeperOrderResult;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;

public class KeeperOrderHistoryAdapter extends BaseQuickAdapter<KeeperOrderResult, BaseViewHolder> {
    public KeeperOrderHistoryAdapter() {
        super(R.layout.item_keeper_order, new ArrayList<>());
        addChildClickViewIds(R.id.btn_order_report, R.id.btn_order_again);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, KeeperOrderResult itemResult) {
        holder.setText(R.id.tv_service_name, itemResult.getServiceName());
        holder.setText(R.id.tv_time, itemResult.getOrderTime());
        holder.setText(R.id.tv_remarks, itemResult.getRemarks());
        holder.setText(R.id.tv_appoint_time, String.format("预约时间: %s", itemResult.getAppointTime()));
        holder.setText(R.id.tv_order_no, String.format("订单编号: %s", itemResult.getOrderNum()));
    }
}
